﻿@using NB.MGJ.Model;
@{
    Layout = null;
    organization_collectsendgoods send = ViewBag.send as organization_collectsendgoods; 
}
@*发货*@
<form role="form" id="form_AddOutAddress" onkeydown="if(event.keyCode==13){return false;}">
    <div class="form-group RowAlgnTop">
        <div class="col-xs-2 col-md-2 text-right">
            <span style=" color:red;">*</span>
            发货人：
        </div>
        <div class="col-xs-6 col-md-6 place">
            <input class="form-control" type="text" name="Person" value="@send.Person" placeholder="请输入发货人" maxlength="20" />
            <input type="hidden" value="@send.ID" name="ID">
            <input type="hidden" value="1" name="CollectSendType">
            <input type="hidden" name="EnterpriseId" id="EnterpriseIdOut" value="@send.EnterpriseId" />
        </div>
    </div>
    <div class="form-group RowAlgnTop">
        <div class="col-xs-2 col-md-2 text-right">
            <span style=" color:red;">*</span>
            邮编：
        </div>
        <div class="col-xs-6 col-md-6 place">
            <input class="form-control" type="text" name="ZipCode" value="@send.ZipCode" placeholder="请输入6位数邮编" maxlength="6" />
        </div>
    </div>
    <div class="form-group RowAlgnTop">
        <div class="col-xs-2 col-md-2 text-right">
            <span style=" color:red;">*</span>
            手机：
        </div>
        <div class="col-xs-6 col-md-6 place">
            <input class="form-control" type="text" name="Mobile" value="@send.Mobile" placeholder="请输入手机" maxlength="11" />
        </div>
    </div>

    <div class="form-group RowAlgnTop">
        <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 text-right">
            <span style=" color:red;">*</span>
            <span>&nbsp;所在地：</span>
        </div>

        <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 place">
            <select class="form-control" id="ProvinceId" name="ProvinceId"></select>
        </div>
        <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3 place">
            <select class="form-control" id="City" name="City"></select>
        </div>
        <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3 place">
            <select class="form-control" id="Region" name="Region"></select>
        </div>
    </div>

    <div class="form-group RowAlgnTop">
        <div class="col-xs-2 col-md-2 text-right">
            <span style=" color:red;">*</span>
            详细地址：
        </div>
        <div class="col-xs-6 col-md-6 place">
            <input class="form-control" type="text" name="Address" value="@send.Address" placeholder="请输入详细地址" maxlength="50" />
        </div>
    </div>
    <div class="form-group RowAlgnTop">
        <div class="col-xs-2 col-md-2 text-right">
            备注：
        </div>
        <div class="col-xs-6 col-md-6">
            <input class="form-control" type="text" name="Remark" value="@send.Remark" />
        </div>
    </div>

</form>
<script>
    //input验证
    $('#form_AddOutAddress').bootstrapValidator({
        message: '类型名称不能为空',
        excluded: [':disabled'],
        group: '.place',
        fields: {
            Person: {
                validators: {
                    notEmpty: {
                        message: '发货人不能为空'
                    },
                    regexp: {
                        regexp: /^[a-zA-Z\u4e00-\u9fa5]+$/,
                        message: '发货人不能输入符号和数字'
                    },
                    stringLength: {
                        max: 20,
                        message: '发货人最大长度为20',
                    }
                }
            },
            ZipCode: {
                validators: {
                    notEmpty: {
                        message: '邮编不能为空'
                    },
                    regexp: {
                        regexp: /^[1-9][0-9]{5}$/,
                        message: '邮编格式错误'
                    }
                }
            },
            Mobile: {
                validators: {
                    notEmpty: {
                        message: '手机号不能为空'
                    },
                    regexp: {
                        regexp: /^1[0-9]{10}$/,
                        message: '手机号码格式错误'
                    }
                }
            },
            ProvinceId: {
                validators: {
                    notEmpty: {
                        message: '省级尚未选择'
                    }
                }
            },
            City: {
                validators: {
                    notEmpty: {
                        message: '市级尚未选择'
                    }
                }
            },
            Region: {
                validators: {
                    notEmpty: {
                        message: '区级尚未选择'
                    }
                }
            },
            Address: {
                validators: {
                    notEmpty: {
                        message: '详细地址不能为空'
                    },
                    stringLength: {
                        max: 50,
                        message: '详细地址最大长度为50',
                    },
                    regexp: {
                        regexp: /^[a-zA-Z0-9\u4e00-\u9fa5]+$/,
                        message: '详细地址不能输入符号'
                    }
                }
            }
        }
    });
    $(function () {
        $my.GetPCR(@send.ProvinceId+0, @send.City+0, @send.Region+0);
    });
</script>